import { ajaxGet, jsonPost } from '@/util'
import { Notice } from 'view-design'
function setFactoryMsgDTOList (state, data) {
  (data || []).forEach(item => {
    if (item.msgTypeEnum == 'BEFORE') {
      state.form.phoneRemind.listRemind[0].time = item.msgHours
      state.form.phoneRemind.listRemind[0].text = item.msgContent
      state.form.phoneRemind.listRemind[0].isRemind = !!((item.msgStatusEnum == 'ON' || item.msgStatusEnum == 'OVER'))
    } else if (item.msgTypeEnum == 'ING') {
      state.form.phoneRemind.listRemind[1].text = item.msgContent
      state.form.phoneRemind.listRemind[1].isRemind = !!((item.msgStatusEnum == 'ON' || item.msgStatusEnum == 'OVER'))
    } else if (item.msgTypeEnum == 'AFTER') {
      state.form.phoneRemind.listRemind[2].time = item.msgHours
      state.form.phoneRemind.listRemind[2].text = item.msgContent
      state.form.phoneRemind.listRemind[2].isRemind = !!((item.msgStatusEnum == 'ON' || item.msgStatusEnum == 'OVER'))
    }
  })
  if (!data.length) {
    state.form.phoneRemind.listRemind.forEach(item => {
      item.isRemind = false
    })
  }
}
function checkProduct (param) {
  jsonPost('/activity/factory_info/check_product', param).then(data => {
    let newArray = []
    newArray = data.productCheckResultList.map(item => {
      return item.skuSn
    })
    let text = ''
    if (data.isSuccess) { // 是否成功，TRUE:成功表示可以创建，false:表示失败不可以创建
      if (data.isChecked) { // 是否需要审核,TURE：需审核，false:不需要审核可以直接保存，null则查看
        text = newArray.join(',') + '加入促销可能会引起审核'
      }
      if (data.isReject) { // 是否驳回：true:直接驳回，不存在false，null表示不做参考
        text = newArray.join(',') + '加入促销可能会引起驳回'
      }
    } else {
      text = newArray.join(',') + '加入促销可能会引起创建不成功'
    }
    newArray.length && Notice.warning({
      title: '温馨提示',
      desc: text
    })
  })
}
function saveProduct (param) {
  let self = param.self
  jsonPost('/activity/factory_info/batch_save_product', { productSkuList: param.productSkuList, activityId: param.activityId }).then(data => {
    let text = ''
    if (Array.isArray(data)) {
      for (let item of data) {
        text = text + item.skuSn + '、'
      }
      text = text + '选择的商品SKU有重复、不存在或者与其他活动有冲突, 部分商品会加入成功'
    }
    if (text) alert(text)
    if (param.type == '1') { // 限制品牌
      self.$store.dispatch('getSkuCount', { id: param.activityId, isLimitBrand: true })
      if (!Array.isArray(data)) {
        Notice.success({
          title: '温馨提示',
          desc: '加入限制品牌成功'
        })
      }
      // self.$store.dispatch('getSkuPage', {isLimitBrand: true, activityId: param.activityId, size: window.$pageSize, current: 1, self: self})
    } else { // 不限品牌
      self.$store.dispatch('getSkuCount', { id: param.activityId, isLimitBrand: false })
      if (!Array.isArray(data)) {
        Notice.success({
          title: '温馨提示',
          desc: '加入不限制品牌成功'
        })
      }
      // self.$store.dispatch('getSkuPage', {isLimitBrand: false, activityId: param.activityId, size: window.$pageSize, current: 1, self: self})
    }
  })
}
function saveOtherProduct (state, param, productSkuList) {
  let self = param.self
  jsonPost('/activity/sku/batch_save_product', { productSkuList: productSkuList, activityId: param.activityId }).then(data => {
    let text = ''
    if (Array.isArray(data)) {
      for (let item of data) {
        text = text + item.skuSn + '、'
      }
      text = text + '选择的商品SKU有重复、不存在或者与其他活动有冲突, 部分商品会加入成功'
    }
    if (text) alert(text)
    self.$store.dispatch('getOtherSkuCount', { id: param.activityId })
    Notice.success({
      title: '温馨提示',
      desc: '加入主商品成功'
    })
  })
}
function setOtherData (data) {
  return (data.records || []).map(item => {
    return {
      id: item.item[0].productId,
      checked: false,
      buttonChecked: false,
      showChildren: false,
      sale: '',
      limitQuantity: '',
      code: item.productSn,
      salePrice: '',
      reduce: '',
      stock: '',
      isShelf: item.isShelf,
      discount: '',
      title: item.title,
      quantity: item.quantity,
      productSkuList: item.item.map(todo => {
        return {
          id: todo.skuId,
          acId: todo.id,
          productId: todo.productId,
          productSn: todo.productSn,
          parentcode: todo.productSn,
          checked: false,
          buttonChecked: false,
          showChildren: false,
          limitQuantity: '',
          code: todo.skuSn,
          salePrice: todo.productSkuInfo.salePrice,
          reduce: '',
          sale: todo.promotionPrice,
          isShelf: todo.isShelf,
          discount: '',
          title: '',
          stock: todo.productSkuInfo.stock,
          returnPrice: '',
          quantity: item.quantity
        }
      })
    }
  })
}
function setData (data) {
  return (data.records || []).map(item => {
    return {
      id: item.productId,
      parentcode: item.productSn,
      checked: false,
      buttonChecked: false,
      showChildren: false,
      sale: '',
      limitQuantity: '',
      code: item.productSn,
      salePrice: '',
      giftPoint: '',
      warningQuantity: '',
      sellOutQuantity: '',
      giftRebate: '',
      giftCouponId: '',
      reduce: '',
      stock: '',
      // isShelf: item[0].isShelf,
      discount: '',
      title: item.productName,
      // quantity: item[0].quantity,
      productSkuList: item.skuList.map(todo => {
        return {
          id: todo.skuId,
          acId: todo.id,
          isReplenish: true,
          productId: todo.productId,
          isLimitBrand: todo.isLimitBrand,
          productSn: todo.productSn,
          parentcode: todo.productSn,
          checked: false,
          buttonChecked: false,
          showChildren: false,
          limitQuantity: '',
          title: todo.productName,
          code: todo.skuSn,
          salePrice: todo.originalPrice,
          reduce: '',
          sale: todo.promotionPrice,
          stock: '',
          isShelf: todo.isShelf,
          discount: '',
          // stock: todo.productSkuInfo.stock,
          returnPrice: todo.returnPrice,
          quantity: item.quantity,
          giftPoint: todo.activityFactoryGift && (todo.activityFactoryGift.giftPoint == 0 ? '' : todo.activityFactoryGift.giftPoint),
          warningQuantity: todo.warningQuantity,
          sellOutQuantity: todo.sellOutQuantity,
          giftRebate: todo.activityFactoryGift && (todo.activityFactoryGift.giftRebate == 0 ? '' : todo.activityFactoryGift.giftRebate),
          giftCouponId: todo.activityFactoryGift && todo.activityFactoryGift.giftCouponId,
          giftCouponName: todo.activityFactoryGift && todo.activityFactoryGift.giftCouponName
        }
      })
    }
  })
}
function getProductData (data) {
  let text = ''
  for (let item of data) {
    for (let todo of item.productSkuList) {
      text = text + todo.code + ','
    }
  }
  return text
}
function getLimit (data, param) {
  let newArray = []
  for (let item of data) {
    for (let todo of item['productSkuList']) {
      newArray.push({
        isLimitBrand: param, // false-不限制 true-限制
        productId: todo.productId,
        skuId: todo.id,
        productSn: todo.parentcode,
        skuSn: todo.code,
        sellOutQuantity: todo.sellOutQuantity, // 促销库存
        promotionPrice: todo.sale,
        activityFactoryGift: { 'giftCouponId': todo.giftCouponId == '0' ? '' : todo.giftCouponId, 'giftPoint': todo.giftPoint, 'giftRebate': todo.giftRebate }
      })
    }
  }
  return newArray
}
function getProductChecked (data) {
  let newArray = []
  for (let item of data) {
    for (let todo of item['productSkuList']) {
      newArray.push({
        productId: todo.productId,
        skuId: todo.id,
        productSn: todo.parentcode,
        skuSn: todo.code,
        sellOutQuantity: todo.sellOutQuantity, // 促销库存
        promotionPrice: todo.salePrice
      })
    }
  }
  return newArray
}
function getProductTodo (todo) {
  let newArray = []
  newArray.push({
    productId: todo.productId,
    skuId: todo.id,
    productSn: todo.parentcode,
    skuSn: todo.code,
    sellOutQuantity: todo.sellOutQuantity, // 促销库存
    promotionPrice: todo.sale
  })
  return newArray
}
function getProductItem (Item) {
  let newArray = []
  for (let todo of Item['productSkuList']) {
    newArray.push({
      productId: todo.productId,
      skuId: todo.id,
      productSn: todo.parentcode,
      skuSn: todo.code,
      sellOutQuantity: todo.sellOutQuantity, // 促销库存
      promotionPrice: todo.sale
    })
  }
  return newArray
}
function compareFactorySale (data, data1, object) {
  /*
    1、data 当前的导入的数据
    2、data1 比较的数据
    3、object数据及类型
  */
  for (let item of data1) {
    for (let todo of item.productSkuList) {
      compareFactTodo(object.data, todo)
    }
  }
  spliceGetDataItem(object.data, data)
  spliceGetDataTodo(object.data, data)
}
function compareFactTodo (importData, data) {
  for (var i = 0; i < importData.length; i++) {
    for (var j = 0; j < importData[i].productSkuList.length; j++) {
      if (data.id == importData[i].productSkuList[j].id) {
        importData[i].productSkuList.splice(j, 1)
        j--
      }
    }
    if (!importData[i].productSkuList.length) {
      importData.splice(i, 1)
      i--
    }
  }
}
function compareSaleGift (saleData, data, type, fSet, limitQuantity, sellOutQuantity) {
  /*
    1、 获取checked的为true的sku
    2、 把对应的赠品的barcode把更改saleData的checked属性--》最后进行提交（1、有对应的赠品的时候2、没对应的商品）
    3、 data
  */
  if (data.length) {
    for (let item of data) {
      compareItem(saleData, item.id)
      for (let todo of item.productSkuList) {
        compareTodo(saleData, todo.id, todo, type, fSet, limitQuantity, sellOutQuantity)
      }
    }
  }
}
function compareItem (saleData, id) {
  for (let item of saleData) {
    if (id == item.id) {
      item.buttonChecked = true
    }
  }
}
function compareTodo (saleData, id, data, type, fSet, limitQuantity, sellOutQuantity) {
  for (let item of saleData) {
    for (let todo of item.productSkuList) {
      if (id == todo.id) {
        todo.buttonChecked = true
        if (type) {
          todo[type] = data[type]
          fSet(todo, item)
        }
        if (limitQuantity) {
          todo[limitQuantity] = data[limitQuantity]
        }
        if (sellOutQuantity) {
          todo[sellOutQuantity] = data[sellOutQuantity]
          onSet(todo, item, 'sellOutQuantity')
        }
      }
    }
  }
}
function compareOther (saleData, data, data1, type, type1) {
  /**/
  window.conflict = []
  let otherGift = getGiftbarcode(data, data1, type, type1)
  for (let item of otherGift) {
    setGiftBarcode(saleData, item)
  }
  /*区分到底是哪阶有重复*/
  let conflictWord = ''
  if (type) {
    let status = false
    for (let todo of window.conflict) {
      if (type == todo.index1) {
        status = true
        conflictWord = conflictWord + todo.index + ','
      }
    }
    if (status) {
      conflictWord = conflictWord + '已在' + type
    }
  }
  if (type1) {
    let status1 = false
    for (let todo1 of window.conflict) {
      if (type1 == todo1.index1) {
        status1 = true
        conflictWord = conflictWord + todo1.index + ','
      }
    }
    if (status1) {
      conflictWord = conflictWord + '已在' + type1
    }
  }
  if (conflictWord) {
    alert(conflictWord)
  }
}
// 一阶赠品和二阶赠品以及三阶赠品的不能拥有同一个赠品
function getGiftbarcode (data, data1, type, type1) {
  let giftCode = []
  for (let item of data) {
    for (let todo of item.productSkuList) {
      giftCode.push({ index: todo.code, index1: type })
    }
  }
  for (let item1 of data1) {
    for (let val of item1.productSkuList) {
      giftCode.push({ index: val.code, index1: type1 })
    }
  }
  return giftCode
}
function setGiftBarcode (saleData, param) {
  for (let item of saleData) {
    let status = false
    for (let todo of item.productSkuList) {
      if (todo.checked && param.index == todo.code) {
        todo.checked = false
        if (param) {
          conflict.push(param)
        }
      }
      if (todo.checked) {
        status = true
      }
    }
    // debugger
    if (status) {
      item.checked = true
    } else {
      item.checked = false
    }
  }
}
function deleteSale (index, data, index1, data1) { //删除已选促销
  if (index1 || index == 0) {
    if (data.length == 1 && data1) {
      data1.splice(index1, 1)
    } else {
      data && data.splice(index, 1)
    }
  } else {
    data.splice(index, 1)
  }
}
//给SKU添加code
function getCode (self, data, val) {
  for (let item of data) {
    for (let todo of item[val.childName]) {
      self.$set(todo, val.index, item.code)
    }
  }
}
// 获取已选商品SKU
function getPuduct (data, val) {
  let newArray = []
  // postParam:["productId","skuId","promotionPrice","isMustBuy"]
  // getParam:['productId','id','salePrice','isShelf']
  for (let item of data) {
    for (let todo of item[val.child]) {
      newArray.push({
        'productId': todo[val.getParam[0]],
        'skuId': todo[val.getParam[1]],
        'productSn': todo[val.getParam[2]],
        'skuSn': todo[val.getParam[3]]
      })
    }
  }
  return newArray
}
//获取最大值
function getMaxValue (param, object) {
  if (!param) {
    return false
  }
  for (let item of param) {
    let isTrue = true
    for (let todo of param) {
      if (item[object.index] < todo[object.index]) {
        isTrue = false
      }
    }
    if (isTrue) {
      return item[object.index]
    }
  }
}
// 获取最小值
function getMinValue (param, object) {
  if (!param) {
    return false
  }
  for (let item of param) {
    let isTrue = true
    for (let todo of param) {
      if (item[object.index] > todo[object.index]) {
        isTrue = false
      }
    }
    if (isTrue) {
      return item[object.index]
    }
  }
}
function getMinMaxValue (param, object) {
  return `${getMinValue(param, object)}-${getMaxValue(param, object)}`
}
//获取累加值
function getSum (param, object) {
  if (!param) {
    return false
  }
  let array = 0
  param.map(function (value, index, item) {
    array = array + value[object.index]
  })
  return array
}
//递归设置及更改数组某一个属性的值
function setArrayValue (data, val) {
  for (let item of data) {
    item[val.index] = val.val1
    if (item[val.childName] && item[val.childName].length) {
      setArrayValue(item[val.childName], val)
    }
  }
}
//针对vue新添加数组某一个属性的值
function setAdd (self, data, val) {
  for (let item of data) {
    self.$set(item, val.index, val.val1)
    if (item[val.childName] && item[val.childName].length) {
      setAdd(self, item[val.childName], val)
    }
  }
}
// 递归更换数组中的值
function setExchangeValue (data, val) {
  for (let item of data) {
    item[val.index] = JSON.parse(JSON.stringify(item[val.index1]))
    if (item[val.childName] && item[val.childName].length) {
      setExchangeValue(item[val.childName], val)
    }
  }
}
//子集父集的关系
function onJoinSaleBody (item, todo, params) {
  if (item[params.index1] && [params.index1].length > 0) {
    item[params.index]
      ? setArrayValue(item[params.index1], {
        index: params.index,
        val1: true,
        childName: params.index1
      })
      : setArrayValue(item[params.index1], {
        index: params.index,
        val1: false,
        childName: params.index1
      })
  } else if (!item[params.index1]) {
    /* 当是子集的时候，选择一个对应的父级就选上 */
    let status = false
    if (!todo) {
      return false
    }
    for (let child of todo[params.index1]) {
      if (child[params.index]) {
        status = true
      }
    }
    if (!status) {
      //子集没有被选中
      todo[params.index] = false
    } else {
      todo[params.index] = true
    }
  }
}
//
export function deleteValueArray (data, val, data1) { //data为已选商品 data1为商品列表
  for (let key in data) {
    let status = true
    if (data[key][val.childName] && data[key][val.index]) {
      for (let todo in data[key][val.childName]) {
        if (data[key][val.childName][todo][val.index]) {
          onDeleteBodyTodo(data1, { index: data[key][val.childName][todo], childName: 'productSkuList' })
          data[key][val.childName][todo] = ''
        } else {
          status = false
        }
      }
    }
    if (!data[key][val.index]) {
      status = false
    }
    if (status) {
      onDeleteBodyItem(data1, { index: data[key] })
      data[key] = ''
    }
  }
}
export function onDeleteSale (index, data, index1, data1, saleData) {
  if (index1 || index1 == 0 || index == 0) { // 当是子集按钮删除的时候
    if (data.length == 1 && data1) { // 当是删掉的自己还有一个的时候
      onDeleteBodyTodo(saleData, { index: data[index], childName: 'productSkuList' })
      onDeleteBodyItem(saleData, { index: data1[index1] })
      data1[index1].buttonChecked = false
      data1.splice(index1, 1)
    } else { // 正常的删掉一个子集的时候
      if (data[index].productSkuList) { //有子集
        for (let item of data[index].productSkuList) {
          onDeleteBodyTodo(saleData, { index: item, childName: 'productSkuList' })
        }
        onDeleteBodyItem(saleData, { index: data[index] })
      } else { // 没子集
        onDeleteBodyTodo(saleData, { index: data[index], childName: 'productSkuList' })
      }
      data && data.splice(index, 1)
    }
  } else { // 当是父级按钮删除的时候
    for (let item of data[index].productSkuList) {
      onDeleteBodyTodo(saleData, { index: item, childName: 'productSkuList' })
    }
    onDeleteBodyItem(saleData, { index: data[index] })
    data.splice(index, 1)
  }
}
function onDeleteBodyTodo (data, val) {
  for (let item of data) {
    for (let todo of item[val.childName]) {
      if (val.index.id == todo.id) {
        todo.buttonChecked = false
      }
    }
  }
}
function onDeleteBodyItem (data, val) {
  for (let item of data) {
    if (val.index.id == item.id) {
      item.buttonChecked = false
    }
  }
}
// 获取子集的数量
function getSaleNum (data, params) {
  let num = 0
  for (let item of data) {
    num = num + item[params.childName].length
  }
  return num
}
//
function isPriceEmpty (data, val) {
  let status = false
  for (let item of data) {
    for (let todo of item[val.childName]) {
      if (!todo[val.index] && todo[val.index1]) {
        status = true
      }
    }
  }
  return status
}
function getSelectStatus (data, val) {
  let status = true
  for (let item of data) {
    if (!item[val.index]) {
      status = false
    }
    if (item[val.childName] && item[val.childName].length) {
      return getSelectStatus(item[val.childName], val)
    }
  }
  return status
}
function isPriceEmptyItem (data, val) {
  let status = false
  if (data[val.childName] && data[val.childName].length > 0) {
    for (let item of data[val.childName]) {
      if (!item[val.index]) {
        status = true
      }
    }
  } else {
    if (!data[val.index]) {
      status = true
    }
  }
  return status
}
function isBigSix (data, val) {
  let status = false
  for (let item of data) {
    for (let todo of item[val.childName]) {
      if (todo[val.index] < 6 && todo[val.index1]) {
        status = true
      }
    }
  }
  return status
}
function isBigSixItem (data, val) {
  let status = false
  if (data[val.childName] && data[val.childName].length > 0) {
    for (let item of data[val.childName]) {
      if (item[val.index] < 6) {
        status = true
      }
    }
  } else {
    if (data[val.index] < 6) {
      status = true
    }
  }
  return status
}
const plusZero = (value) => {
  return value < 10 ? '0' + value : value
}
function formatDate (value, hasTime) {
  if (!value) return ''
  if (typeof value === 'string') {
    value = value.replace(/\-/g, '/')
  }
  value = new Date(value)
  let result = ''
  let year = value.getFullYear()
  let month = value.getMonth() + 1
  let day = value.getDate()

  month = plusZero(month)
  day = plusZero(day)

  result = year + '-' + month + '-' + day

  if (hasTime) {
    let hour = value.getHours()
    let minute = value.getMinutes()
    let seconds = value.getSeconds()
    hour = plusZero(hour)
    minute = plusZero(minute)
    seconds = plusZero(seconds)
    result += ' ' + hour + ':' + minute + ':' + seconds
  }

  return result
}
function getValueArray (data, val) {
  /*
          1、如果父级的checked为false,就把父级删掉
          2、如果子集的checked为false，就删掉
  */
  for (let key in data) {
    if (data[key][val.index] == val.status) {
      data[key] = ''
    }
    if (data[key][val.childName] && data[key][val.childName].length) {
      getValueArray(data[key][val.childName], val)
    }
  }
}
function setEmptyArray (data, val) {
  for (var i = 0; i < data.length; i++) {
    if (data[i] == '' || data[i] == null || typeof (data[i]) == undefined) {
      data.splice(i, 1)
      i = i - 1
    }
    if (data[i]) {
      if (data[i][val.childName] && data[i][val.childName].length) {
        setEmptyArray(data[i][val.childName], val)
      }
    }
  }
}
function setItemData (item1, getData) {
  let object = {
    status: false
  }
  for (let item of getData) {
    if (item.id == item1.id) {
      return false
    } else {
      object.status = true
    }
  }
  if (object.status) {
    getData.splice(getData.length, 0, item1)
    return false
  }
}
function setTodoData (item1, todo1, getData) {
  let object = {
    status: false
  }
  for (let item of getData) {
    if (item1.id == item.id) {
      for (let todo of item.productSkuList) {
        if (todo.id == todo1.id) {
          return false
        } else {
          object.status = true
        }
      }
    }
    if (object.status) {
      item.productSkuList.splice(item.productSkuList.length, 0, todo1)
      return false
    }
  }
}
function spliceGetDataItem (data, getData) {
  for (let item of data) {
    setItemData(item, getData)
  }
}
function spliceGetDataTodo (data, getData) {
  for (let item of data) {
    for (let todo of item.productSkuList) {
      setTodoData(item, todo, getData)
    }
  }
}
function deleteRightTodo (todo1, item1, data) {
  data.forEach(function (item, index, array) {
    if (item1.id == item.id) {
      item.productSkuList.forEach(function (todo, index1, array1) {
        if (todo.id == todo1.id) {
          if (item.productSkuList.length == 1) {
            item.productSkuList.splice(index1, 1)
            deleteRightItem(item1, data)
          } else {
            item.productSkuList.splice(index1, 1)
          }
        }
      })
    }
  })
}
function deleteRightItem (item1, data) {
  data.forEach(function (item, index, array) {
    if (item.id == item1.id) {
      data.splice(index, 1)
    }
  })
}
function setBatchData (data, value, type) {
  for (let item of data) {
    for (let todo of item.productSkuList) {
      if (todo.checked) todo[type] = value
      if (todo.checked) onSet(todo, item, type)
    }
  }
}
function setItem (data, num) {
  for (let item of data) {
    for (let todo of item.productSkuList) {
      for (let type of num) {
        onSet(todo, item, type)
      }
    }
  }
}
function setChild (data, type) {
  for (let item of data.productSkuList) {
    item[type] = type == 'sellOutQuantity' ? Number(data[type]).toFixed(0) : Number(data[type])
  }
}
function onSet (item, todo, type) {
  if (!item[type] || !/^([\+ \-]?([1-9]\d*)|(0))([.]\d{0,2})?$/.test(item[type])) {
    return false
  }
  if (item.productSkuList && item.productSkuList.length > 0) {
    setChild(item, type)
  } else if (!item.productSkuList) {
    todo[type] = `${getMinValue(todo.productSkuList, { index: type }) || 0} - ${getMaxValue(todo.productSkuList, { index: type })}`
  }
}
function setDTOList (state, data) {
  for (let item of state.form.list) {
    for (let todo of data) {
      if (item.value == todo.storeTypeEnum) {
        item.num = todo.limitNumber
        item.isChecked = true
        item.totalNum = todo.totalLimitNumber ? todo.totalLimitNumber : ''
      }
    }
  }
}
function deleteDistib (state, type) {
  let index = 'distribList'
  let index1 = 'distribedList'
  if (typeof (type) === 'string' && type === 'pay') {
    index = 'payDistribList'
    index1 = 'payDistribedList'
  }
  if (typeof (type) === 'string' && type === 'delay') {
    index = 'delayDistribList'
    index1 = 'delayDistribedList'
  }
  if (state.form[index1]) {
    state.form[index] = state.form[index].filter(item => !state.form[index1].find(s => s.id == item.id))
  }
}
export {
  deleteSale,
  getCode,
  getPuduct,
  getMaxValue,
  getMinValue,
  getMinMaxValue,
  getSum,
  setArrayValue,
  setAdd,
  setExchangeValue,
  onJoinSaleBody,
  getSaleNum,
  isPriceEmpty,
  isBigSix,
  isBigSixItem,
  isPriceEmptyItem,
  onDeleteBodyTodo,
  onDeleteBodyItem,
  formatDate,
  compareSaleGift,
  compareOther,
  getValueArray,
  setEmptyArray,
  spliceGetDataItem,
  spliceGetDataTodo,
  deleteRightTodo,
  deleteRightItem,
  setBatchData,
  onSet,
  setDTOList,
  deleteDistib,
  compareFactorySale,
  getSelectStatus,
  getLimit,
  checkProduct,
  getProductData,
  saveProduct,
  setData,
  setItem,
  setFactoryMsgDTOList,
  getProductChecked,
  saveOtherProduct,
  getProductTodo,
  getProductItem,
  setOtherData
}
